// 读取系统cpu的信息
const os = require('os')
const cups = os.cpus()
// console.log(cups)
console.log(cups.length)

// 获取内存的信息
const total = os.totalmem() // types
console.log(total / 1024 / 1024 / 1024)


// 获取剩余的内存
const free = os.freemem()
console.log(free / 1024 / 1024 / 1024)


// web服务
// ajax--->api-->web server(nodejs)
const http = require('http')
const server = http.createServer((req, res) => {
  res.end('hello')
})
server.listen(1000, '127.0.0.1', () => {
  console.log('服务器启动成功')
})